projects
/
gtk4.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5531906
)
stack: Increase reference only if page is non-NULL
author
Mohammed Sadiq
<sadiq@sadiqpk.org>
Wed, 24 Mar 2021 13:48:02 +0000
(19:18 +0530)
committer
Mohammed Sadiq
<sadiq@sadiqpk.org>
Wed, 24 Mar 2021 14:51:13 +0000
(20:21 +0530)
g_list_nth_data() may return NULL if position is off the end
gtk/gtkstack.c
patch
|
blob
|
history
diff --git
a/gtk/gtkstack.c
b/gtk/gtkstack.c
index 41aa4958b5ec1ad73e563366f28d4fe038c2d795..9b1488b3b20a261f275201bee5c1d4d05b2e2ced 100644
(file)
--- a/
gtk/gtkstack.c
+++ b/
gtk/gtkstack.c
@@
-538,6
+538,9
@@
gtk_stack_pages_get_item (GListModel *model,
page = g_list_nth_data (priv->children, position);
+ if (!page)
+ return NULL;
+
return g_object_ref (page);
}